﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
using System.Web.Mvc;
using XinYi.CrookedShow.BLL;
using XinYi.CrookedShowMode;

namespace XinYi.CrookedShowBack.Controllers
{
    public class CategoryController : Controller
    {
        /// <summary>
        /// 分类表的业务逻辑层
        /// </summary>
        /// <returns></returns>
        CategoryService categoryService = new CategoryService();
        // GET: Category
        public JsonResult GetCategoryInfo()
        {
            Expression<Func<Category, bool>> lambdaExpression = a => a.ParentId == 0;
            List<Category> categories=categoryService.QueryList(lambdaExpression);
            return Json(categories,JsonRequestBehavior.AllowGet);
        }
    }
}